<el-dialog title="内容标签" :visible.sync="dialog" width="30%" top="30vh" :before-close="handleClose">
	<el-input v-model="title" placeholder="请填写标签名称" @keyup.enter.native="saveTag(id)"></el-input>
	<span slot="footer" class="dialog-footer">
		<el-button @click="handleClose">取 消</el-button>
		<el-button type="primary" @click="saveTag(id)">确 定</el-button>
	</span>
</el-dialog>

<script>
	// 增
	let newArr = {
		'id': this.supplylist.length + 1,
		'title': this.title,
		'type': 'Supply'
	}
	this.supplylist.push(newArr)
	// 改
	this.supplylist.forEach((value, index, arr) => {
		if (index == id - 1) {
			arr[index].title = this.title
		}
	})
	// 删
	this.supplylist.splice(id - 1, 1)
	// 按id排序
	this.supplylist.forEach((value, index, arr) => {
		arr[index].id = index + 1
	})
	// 复制
	let copyArr = this.supplylist.filter(item => {
		return item.id === id
	})
	let newArr2 = {
		'id': this.supplylist.length + 1,
		'title': copyArr[0].title,
		'type': 'Supply'
	}
	this.supplylist.push(newArr)
</script>

<script>
	// js数组方法
var array=['a','b']
array.pop()	//删除最后一个元素
array.push('kiwi')	//在结尾添加新元素
array.shift()	//删除第一个元素
array.unshift('le')	//在开头添加新元素
array[0]='kiwi'	//改变数组元素
array[array.length]='kiwi'	//添加元素
delete array[0]	//删除
array.splice(2,0,'lemon','kiwi')	//添加元素
array.splice(0,1)	//删除第一个元素

var arr=window.location.href.split('/')	//分解为数组
arr=arr.join('/')	//合并
</script>
	// obj添加数据
	const purchasesTypeList = await getMapList('PurchaseTypeEnum');
	// console.log(
	//   getMapList('PurchaseTypeEnum').then((res) => res),
	// );
	purchasesTypeList.ALL = {
		code: 0,
		key: 0,
		name: '全部',
		order: 0,
	};
	this.purKey = Object.keys(purchasesTypeList);
	this.purKey.pop();
	this.purKey.unshift('ALL');
	this.purchasesTypeList = purchasesTypeList;
<div v-for="(item, index) in purKey" :key="index" class="pushTypeItem"
	:class="{ selected: purchasesTypeList[item].name === currentType.name }"
	@click="selectType(purchasesTypeList[item])">
	{{purchasesTypeList[item].name }}
</div>

<script>
	// 拆分，合并
	const f = state.appMeta.currentPath.split('/')[2].split('-')[0];
	const s = state.appMeta.currentPath.split('/')[2].split('-')[1];
	console.log(f + s[0].toUpperCase() + s.substr(1));
</script>


<script>
	// 判断obj为空
	JSON.stringify({})=='{}'
</script>